<template>
    <div class="container">
        <SignIn v-if="type === 0" @operation="operation" />
        <Register v-if="type === 1" @operation="operation" />
        <Retrieve v-if="type === 2" @operation="operation" />
        <div class="tips" v-show="bool">
            <div @click="operation(1)" v-if="type === 0">没有账号么？注册一个吧！</div>
            <div @click="operation(0)" v-else>已有账号？返回登录</div>
        </div>
    </div>
</template>

<script>
import SignIn from './components/SignIn'      // 登录
import Register from './components/Register'  // 注册
import Retrieve from './components/Retrieve'  // 找回密码
export default {
    name: 'login',
    components: {
        SignIn,
        Register,
        Retrieve
    },
    data() {
        return {
            type: 0,
            bool: true,
        }
    },
    methods: {
        operation(type) {
            this.type = type
            console.log(this.type)
        },
    },
    mounted() {
        console.log('-----', this.$route.query.invite_code)
        if(this.$route.query.invite_code) this.type = 1
    },
}
</script>

<style lang="less" scoped>

.container {
    // background-color: #F2CD24;
    background-color: rgba(184, 168, 101, 0.8);
    height: 100%;
    width: 100%;
    color: #fff !important;
    font-size: 20px;
    font-family: PingFang SC;
    // position: relative;

    .tips {
        width: 100%;
        font-size: .5em;
        // margin-top: 7%;
        position: absolute;
        bottom: 20px;
        text-align: center;
    }
}
</style>